package com.yizhubao.app.activitys;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.github.chrisbanes.photoview.PhotoView;
import com.yizhubao.app.R;
import com.yizhubao.app.base.BaseActivity;

import butterknife.BindView;
import h.framework.pacy.utils.ImageUtil;

/**
 * 创建人: PACY
 * 创建时间: 6/6/21 10:25 AM
 * 邮箱: pengwwe457621023@qq.com
 * 类描述: 预览图片
 */
public class PhotoViewActivity extends BaseActivity {

    @BindView(R.id.photoView)
    PhotoView photoView;

    //地址
    private String path;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);

    }
    @Override
    protected int setContentLayout() {
        return R.layout.activity_photo_view;
    }

    @Override
    protected void initView() {
        Bundle bundle=getIntent().getExtras();
        path=bundle.getString("path");
        ImageUtil.loadImage(path,photoView);

        photoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }

    @Override
    protected void initData() {

    }

}